/// @tags: SequenceAutoMaton
#include <algorithm>
#include <cstdio>
#include <iostream>
#include <vector>

using namespace std;

namespace BlueQuantum {

int const N = 1e5 + 5;

int typ, n, q, m;
int a[N];
vector<int> vec[N];

inline bool solve() {
  int l, b;
  bool flag = true;
  cin >> l;
  for (int j = 1, lst = 0; j <= l; ++j) {
    cin >> b;
    vector<int>::iterator it = upper_bound(vec[b].begin(), vec[b].end(), lst);
    it == vec[b].end() ? flag = false : lst = *it;
  }
  return flag;
}

inline int main() {
  cin >> typ >> n >> q >> m;
  for (int i = 1, a; i <= n; ++i) cin >> a, vec[a].push_back(i);
  while (q--) cout << (solve() ? "Yes" : "No") << "\n";
  return 0;
}

}  // namespace BlueQuantum

int main() {
#ifndef ONLINE_JUDGE
#ifdef LOCAL
  freopen("/tmp/CodeTmp/testdata.in", "r", stdin);
  freopen("/tmp/CodeTmp/testdata.out", "w", stdout);
#else
  freopen("SequenceAutoMaton.in", "r", stdin);
  freopen("SequenceAutoMaton.out", "w", stdout);
#endif
#endif

  ios::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  return BlueQuantum::main();
}
